package com.wenc.psi.vmd;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.wenc.psi.pojo.Employee;
import com.wenc.psi.rpstr.PersonRepository;


public class PersonViewModel extends AndroidViewModel {

    private PersonRepository personRepository;

    public PersonViewModel(@NonNull Application application) {
        super(application);
        personRepository = new PersonRepository(application);
    }

    public LiveData<Employee> getEmployeeLive() {
        return personRepository.getEmployeeLive();
    }

    // 登录
    public Employee login (String userid, String password){
        return personRepository.login(userid, password);
    };

    // 获取员工信息
    public void getEmployeeById(String id){
        personRepository.getEmployeeById(id);
    }
}
